import { createApp } from 'vue'
import ElementPlus from 'element-plus'
import 'element-plus/theme-chalk/index.css'
import i18n from '@/i18n'
import App from '@/App.vue'
import router from '@/router/index'
import store from '@/store/index'
// import directive from '@/directive';
import '@/assets/styles/index.less'

const app = createApp(App)

/**
 * 中间件挂载
 */
async function setupApp() {
  app.use(i18n)
  app.use(ElementPlus, { locale: i18n.global.messages[i18n.global.locale].el })
  app.use(router)
  app.use(store)
  app.mount('#app')
}

setupApp()
